<template>
    <div class="subpage buy-order-pay-success-container">
        <div class="buy-order-success-top">
            <img src="../../../assets/img/home_img20.png" alt="">
            <p>支付成功</p>
            <p>支付金额：{{item.totalNum * item.totalPrice}}元</p>
            <p>求购数量：{{item.totalNum}}头</p>
        </div>
        <div class="buy-order-success-bottom">
            <van-button round class="u-btn-default" to="/">返回首页</van-button>
            <van-button round class="u-btn-default" @click="jumpDetail">查看订单</van-button>
        </div>
    </div>
</template>

<script>
export default {
	data(){
		return {
			id: '',
			item: {}
		}
	},
	created(){
		this.id = this.$route.params.id;
		this.item = JSON.parse(this.$route.query.item)
	},
    methods: {
        jumpDetail() {
            this.$router.push({
				path: '/my/buyOrder/tab3detail/' + this.id
            })
        }
    }
}
</script>

<style lang="scss" scoped>
    .buy-order-pay-success-container {
        width: 100%;
        padding: 60px 49px 0;
        box-sizing: border-box;
        background-color: #fff;
        .buy-order-success-top {
            text-align: center;
            img {
                width: 120px;
                height: 95px;
                object-fit: cover;
            }
            p:nth-of-type(1) {
                margin-top: 24px;
                font-size: 20px;
                font-weight: 500;
            }
            p:nth-of-type(2) {
                margin-top: 12px;
                font-size: 16px;
                color: #5D6164;
            }
            p:nth-of-type(3) {
                margin-top: 6px;
                color: #969C9E;
            }
        }
        .buy-order-success-bottom {
            width: 100%;
            margin-top: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            button {
                width: 120px;
                height: 32px;
                line-height: 32px;
                box-shadow: none;
                border: 1px solid #31BC8D;
                color: #31BC8D;
                font-size: 16px;
            }
        }
    }
</style>